import request from '@/utils/request'
/**
 * 获取角色列表
 * ***/
export function reqGetRoleList(page, pagesize) {
  return request({
    method: 'get',
    url: '/sys/role',
    params: {
      page,
      pagesize
    }
  })
}
// 根据id删除角色
export const reqDeleteRole = (id) => {
  return request({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}
// 新增角色
export const reqAddRole = (data) => {
  return request({
    url: '/sys/role',
    data,
    method: 'post'
  })
}
// 根据id更新角色
export const reqUpdateRole = (data) => {
  return request({
    method: 'put',
    url: `/sys/role/${data.id}`,
    data
  })
}
// 回显
export function reqGetRoleDetail(id) {
  return request({
    method: 'get',
    url: `/sys/role/${id}`
  })
}
